import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Article from '../views/Article.vue'
import Me from '../views/Me.vue'
import Order from '../views/Order.vue'
import chatroom from '../components/chatroom.vue'
import Registry from '../views/registry.vue'
import Login from '../views/Login.vue'
Vue.use(VueRouter)

  const routes = [
    {
      path:'/login',
      component:Login
    },
    {
      path:'/registry',
      component:Registry
    },
    {
      path:'/chatroom',
      component:chatroom
    },
    {
      path:'/order',
      name:'order',
      component:Order
    },
    {
      path:'/me',
      name:'me',
      component:Me
    },
    {
      path:'/article/:id',
      component:Article
    },
    {
      path:'/index',
      name:'index',
      component:Index
    },
    {
      path:'/',
      component:Index
    }
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  routes
})

export default router
